//
//  HBHMainFourthCell.m
//  HubeiHotel
//
//  Created by 张露杰 on 17/11/14.
//  Copyright © 2017年 张露杰. All rights reserved.
//

#import "HBHMainFourthCell.h"
#import "HBHMainGetMoreNoImageView.h"
#import "HBHMainGetMoreView.h"
@implementation HBHMainFourthCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    //    继承父类
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = 0;
    }
    return self;
}

-(void)loadCellWithData:(NSDictionary *)data
{
    //    重新布局
    for (UIView *view in self.contentView.subviews) {
        [view removeFromSuperview];
    }
    self.backgroundColor = [UIColor clearColor];
    
    HBHMainGetMoreNoImageView *view = [[HBHMainGetMoreNoImageView alloc]initWithFrame:CGRectMake(5*screenW_6, 5*screenW_6, 0, 0) complete:^(NSInteger tagNumber){
        if (_choosesixBtnBlock) {
            self.choosesixBtnBlock(tagNumber);
        }
    }];
    [self.contentView addSubview:view];
    
    NSArray *titleImages = @[@"Main_meili_1",@"Main_meili_2"];
    NSArray *titles = @[@"满足你的一切幻想",@"多重优惠等你来享"];
    NSArray *icons = @[@"Main_icon1",@"Main_icon2"];
//    __weak typeof(self)weakSelf = self;
    for (int i = 0; i < 2; i++) {
        HBHMainGetMoreView *moreView = [[HBHMainGetMoreView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(view.frame) + 5*screenW_6, 5*screenW_6 + 87.5*i*screenW_6, 180*screenW_6, 85*screenW_6) titleImage:titleImages[i] title:titles[i] icon:icons[i] complete:^(NSInteger tagNumber){
            if (_choosesixBtnBlock) {
                self.choosesixBtnBlock(tagNumber);
            }
        }];
        moreView.tag = i+1;
        [self.contentView addSubview:moreView];
    }
}

@end
